<div id="comments">
<h3><?php post('comments')?> 条评论</h3>


<?php if ( have_comment() ) : ?>

	<?php while ( fetch_comment() ) : ?>

	<dl class="comment">
		<dt>
			<a name="comment-<?php comment('id') ?>"></a>
			<?php comment('avatar') ?><br />
			<?php comment('author_link') ?>
		</dt>
		<dd>
			<p class="comment_meta"><?php comment('posttime')?> <a href="javascript:;" style="float:right" onclick="reply_comment('<?php comment('id') ?>','<?php comment('author') ?>')">回复</a></p>
			<p><?php comment('content')?></p>
		</dd>
	</dl>

	<?php endwhile; ?>

<?php endif; ?>

<?php if ( check_perm('comment','post') ) : ?>
<h3>发表评论</h3>
<form action="<?php blog('blogdir')?>do.php?ac=postcomment" method="post" id="commentform" name="commentform">
	<input type="hidden" name="comment_postid" value="<?php post('id')?>" />
	<?php if ( $_USER['id'] ) : ?>
	<p>您好，当前你正使用 <strong><?php echo $_USER['name'];?></strong> 登录&nbsp;&nbsp;&nbsp;<a href="<?php blog('blogdir')?>user.php?ac=logout" title="Log out of this account">退出登录</a></p>
	<?php else : ?>
	<p><input type="text" name="comment_author" id="comment_author" value="" size="22" tabindex="1" />
	<label for="comment_author"><small>名称</small></label></p>
	<p><input type="text" name="comment_email" id="comment_email" value="" size="22" tabindex="2" />
	<label for="comment_email"><small>邮箱</small></label></p>
	<p><input type="text" name="comment_url" id="comment_url" value="" size="22" tabindex="3" />
	<label for="comment_url"><small>主页</small></label></p>
	<?php endif; ?>
	<?php if ( check_perm('comment','seccode') ) : ?>
	<p><input type="text" name="comment_seccode" id="comment_seccode" value="" size="10" tabindex="1" />
	<img src="<?php blog('blogdir')?>seccode.php" style="vertical-align:middle;cursor:pointer;" onclick="this.src=this.src+'?t='+ Math.random()" alt="点击换一个验证码" />
	<label for="comment_seccode"><small>验证码</small></label></p>
	<?php endif; ?>
	<p><textarea name="comment_content" id="comment_content" cols="60" rows="7" tabindex="4"></textarea></p>
	<p><input name="submit" type="submit" id="submit" tabindex="5" value="提交评论" />
	</p>
</form>
<script type="text/javascript">
	<!--//--><![CDATA[//><!--
	var commenttextarea = document.getElementById('comment_content');
	commenttextarea.onkeydown = function quickSubmit(e) {
	if (!e) var e = window.event;
	if (e.ctrlKey && e.keyCode == 13){
	document.getElementById('submit').click();
	}
	};
	//--><!]]>
</script>
<?php endif; ?>

</div>
